package com.lehe.controller.admin;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lehe.entry.AdminMenuDto;
import com.lehe.service.impl.UserManagerService;
import com.lehe.util.JsonUtil;

@RequestMapping("admin")
@Controller
public class IndexAdminController extends BaseAdminController{
	
	@Autowired
	private UserManagerService userManagerService;
	
	@RequestMapping
	public String index(Model model){
		List<AdminMenuDto> adminMenuDtoList =  this.getUserMenus();
		model.addAttribute("menus", JsonUtil.obj2Json(adminMenuDtoList));
		Map<String,Object> obj = userManagerService.queryIndexData(this.getGameUserIds(), this.getGameAgentId());
		model.addAttribute("indexData", obj);
		return "admin/index/index";
	}
}
